Ektron CMS400.Net Reference

>>Conducting eCommerce with Ektron CMS400.NET > Products and Catalog Folders > ProductSearch Server Control

ProductSearch Server Control

The ProductSearch server control allows site visitors to search for products on your site. Products are the same as catalog entries in the Workarea. For an eCommerce site, the ability to find products or services on your site is key to generating more sales.

The ProductSearch server control is based on Ektron’s WebSearch server control. Products are similar to content, and information about them is stored in Ektron’s Indexing Catalogs. This provides extremely fast results without impacting the load on your database.

For information on how the Indexing Service works with search, see The Catalog and Index Files.

Note: While the ProductSearch server control is based on the WebSearch server control, some functionality described in Searching Your Web Site does not apply to the ProductSearch server control. For example, the ProductSearch only searches for products added to a Catalog in the Workarea. It does not find images, documents or multimedia.

When you place a ProductSearch server control on a Web page, and a site visitor browses to it, he sees the following.

The control is divided into two sections:

Basic Search (shown above)

Advanced Search (access this by clicking the Advanced Search tab from the Basic Search screen)

Basic Search

The Basic Search finds content that satisfies these criteria.

published

active (archived content is ignored)

its Searchable check box is checked. See Also: The Content Searchable Field.

public. However, private content is available to those with permission to view it, such as membership users after logging in. See Also: Private Content

resides in the CMS catalog specified in the ProductSearch server control’s CatalogId property, or in one of that folder’s subfolders if the control’s Recursive property is set to true

satisfies text and/or query entered in the search box (no value returns nothing)

- The text inserted in the search field can appear in the content or metadata

Searching Multiple Terms

If a site visitor enters several terms, the search only returns pages that include all terms. This is known as an ‘and’ relationship. For example, if the site visitor enters cancer and cure in the Search box, only content that includes both terms (and satisfies the other criteria) appears.

Ektron uses an ‘and’ relationship because we believe it’s what a site visitor expects. Consider a simple Google search – the more you enter into the Google Search text box, the fewer results you get, since your phrase is more precise.

The advanced search screen, on the other hand, lets the site visitor determine if he wants an and, or, not, or exact phrase relationship.

Advanced Search

The Advanced Search uses nearly all the same search criteria as the Basic Search. See Also: Basic Search.

The differences are additional options and filters (explained below) and the fact that you cannot use queries.

Advanced Search Options

Search Option

Finds these pages

with all of the words

Web page must include all submitted terms; their position on the page does not matter.

You cannot enter queries into this field.

advanced search exact phrase

Web page must include the exact phrase. For example, if you enter Large Round Window, a page with the term Large Round Tinted Window is not found because it is not an exact match.

at least one of the words

Web page can include any one of the submitted terms.

without the words

Web page contains none of the submitted terms.

Only use this option if you also reply to one of the three fields above.

Advanced Result Filters

Below the Advanced Search Options is a list of additional fields you can use to refine the search. These are titled Filter Results.

Result Filter

Prompts site visitor to enter

Price Below

the highest price for which a site visitor is willing to search. This is based off of a product’s Sale Price not its List Price.

Price Above

the lowest price for which a site visitor is willing to search. This is based off a product’s Sale Price not its List Price. For example, if you are searching for a product above $350.00, products that lists for $400.00 and are on sale for $300.00 do not show up in the results.

Product SKU

the Stock Keeping Unit for product. This information is set on the product’s Properties tab in the Workarea. See Also: Entering a Catalog Entry’s Properties

To add a filter, click Add Filter. To remove a filter, click Remove to the right of the filter.

The Content Searchable Field

Each content item includes a Content Searchable field. The search only considers catalog entries whose field is checked. See illustration below.

By default, this field is checked when a product is created.

Display of Search Results

Below is an example of the ProductSearch server control’s results page. You can customize it through the use of XSLTs and CSS files.

Optionally, below the search box, a Filter by Category link can appear. When you set the ShowCategories property to True, a site visitor can click it to see a folder structure of taxonomy categories. He can then select categories of interest. When he does, only products that include the search term and which are assigned to the selected categories appear.

Note: Filtering by category works the same way as in the WebSearch server control. See the section Filtering Search Results by Category in that chapter for additional information.

Query Language

Searching by Query Language is described in Query Language. This functionality works the same for product searches as it does for Web searches except for properties related to documents, images and multi-media. Instead, the following properties can be queried for products.

Product Search Query Properties Table

Property

Descriptions

Example

Results

edescription

Searches only the description of a product for the matching text.

The description of a product is set in the Content tab’s editor for a product in the Workarea. See Also: Step 2: Creating the Content Page

@edescription chair

Products with “chair” in the description.

eheight

Searches based on the height of a product.

The height of a product is set on the product’s Properties tab in the Workarea. See Also: Entering a Catalog Entry’s Properties

@eheight = 40

 


@eheight > 40

 



@eheight < 40

Products that have a height equal to 40 inches or centimeters.

Products that have a height greater than 40 inches or centimeters.

Products that have a height less than 40 inches or centimeters.

eimage

Searches based on an image name associated with a product; for example, chair.jpg.

Images are associated with a product when they are added to a product’s Media tab in the Workarea. See Also: Entering a Catalog Entry’s Media

@eimage chair.jpg

Products with an associated “chair.jpg” image.

elength

Searches based on the length of a product.

The length of a product is set on the product’s Properties tab in the Workarea. See Also: Entering a Catalog Entry’s Properties

@elength = 15


 

@elength > 15



@elength < 15

Products that have a length equal to 15 inches or centimeters.

Products that have a length greater than 15 inches or centimeters.

Products that have a length less than 15 inches or centimeters.

elistprice

Searches based on the list price of the product.

The list price for a product is set on the product’s Pricing tab in the Workarea. See Also: Entering a Catalog Entry’s Price Information

@elistprice = 299.00



@elistprice > 299.00


@elistprice < 299.00

Products that have a list price equal to 299.00.

Products that have a list price greater than 299.00.

Products that have a list price less than 299.00.

ereorderlevel

Searches for a product based on its reorder level.

The reorder level for a product is set on the product’s Properties tab in the Workarea. See Also: Entering a Catalog Entry’s Properties

@ereorderlevel = 125




@ereorderlevel > 125


@ereorderlevel < 125

Products that have a reorder level equal to 125.

Products that have a reorder level greater than 125.

Products that have a reorder level less than 125.

esaleprice

Searches based on the sale price of the product.

The sale price for a product is set on the product’s Pricing tab in the Workarea.See Also: Entering a Catalog Entry’s Price Information

@esaleprice = 249.00



@esaleprice > 249.00



@esaleprice < 249.00

Products that have a sale price equal to 249.00.

Products that have a sale price greater than 249.00.

Products that have a sale price less than 249.00.

eskunumber

Searches based on the Stock Keeping Unit for product.

This information is set on the product’s Properties tab in the Workarea. See Also: Entering a Catalog Entry’s Properties

@eskunumber 52-154

Products that have a matching SKU.

eunitsinstock

Searches for a product based on its level of units in stock.

The units in stock for a product is set on the product’s Properties tab in the Workarea. See Also: Entering a Catalog Entry’s Properties

@eunitsinstock = 63




@eunitsinstock > 63


@eunitsinstock < 63

Products that have a unit stock level equal to 63.

Products that have a unit stock level greater than 63.

Products that have a unit stock level less than 63.

eunitsonorder

Searches for a product based on the amount of units on order.

The amount of units on order for a product is set on the item’s Properties tab in the Workarea. See Also: Entering a Catalog Entry’s Properties

@eunitsonorder = 30




@eunitsonorder > 30


@eunitsonorder < 30

Products that have an on order level equal to 30.

Products that have an on order level greater than 30.

Products that have an on order level less than 30.

eweight

Searches based on the weight of a product.

The weight of a product is set on the product’s Properties tab in the Workarea.See Also: Entering a Catalog Entry’s Properties

@eweight = 45

 

 

@eweight > 45


@eweight < 45

Products that have a weight equal to 45 units.

Products that have a weight greater than 45 units.

Products that have a weight less than 45 units.

ewidth

Searches based on the width of a product.

The width of a product is set on the product’s Properties tab in the Workarea. See Also: Entering a Catalog Entry’s Properties

@ewidth = 7


 

@ewidth > 7



@ewidth < 7

Products that have a width equal to 7 inches or centimeters.

Products that have a width greater than 7 inches or centimeters.

Products that have a width less than 7 inches or centimeters.

The Add to Cart Link in a Search Result

Site visitors can add a product to their cart directly from the search results by clicking Add to cart in a search result. This link appears below the price and allows them to skip the product’s information page and add the product directly to their cart.

By default, this link appears when the following conditions are met:

The product is a simple product, kit or bundle. The link does not appear for complex product types. In complex product types, site visitors must select one variation of a product. For example, you are selling movies and the site visitor needs to select between either DVD or Blue-Ray format.

The product is buyable. That is, there is a check mark in the Buyable property for a product in the Workarea. See Also: Entering a Catalog Entry’s Properties

The product has an In Stock quantity of at least one.

The TemplateCart property has a cart’s template location defined.

Property Usage Table

Properties in the ProductSearch server control generally affect the control in one of three ways:

Search Display - the ProductSearch server control’s appearance on your site.

Search Criteria - criteria used to search the site

Search Results Display - appearance of search results on your site

The following table shows which properties are associated with each category. See Also: ProductSearch Server Control Properties

Search Display

Search Criteria

Search Results Display

ButtonImgSrc

ButtonText

EnableAdvancedLink

Hide

Language

MaxCharacters

TextBoxSize

CatalogId

Language

Recursive

ShowCategories

TaxonomyOperator

CustomOrderBy

CustomXml

DisplayXslt

Hide

Language

LinkTarget

LoadingImage

MaxTeaserLength

OrderBy

OrderDirection

ResultsPageSize

ResultTagId

ShowCustomSummary

ShowSearchBoxAlways

Stylesheet

SuppressWrapperTags

TemplateCart

TemplateProduct

Flow of the ProductSearch Server Control

The following image depicts the flow of the ProductSearch Server Control.

ProductSearch Server Control Properties

The following table explains the properties of the ProductSearch control.

Note: The following table only lists Ektron-specific properties. It does not describe native .NET properties such as font, height, width and border style. For documentation of these properties, see Visual Studio help.

Property

Description

Data Type

Authenticated

Indicates if you are logged in to the CMS Explorer
and can use it to browse to Content, Collections, etc. See Also: Working with Ektron CMS400.NET Server Controls

String

ButtonImgSrc

If you want to display an image on the Submit button, enter the server path to it.

String

ButtonText

The text used for the Submit button if no image source is identified. If an image source is identified, this is alternative text for the button.

String

CatalogId

The catalog at which the search begins. The starting folder need not be the root folder.

The Recursive property determines if the search examines this folder’s subfolders. See Also: Working with Ektron CMS400.NET Server Controls

String

CustomOrderBy

Provide a property’s Friendly Name defined in the Indexing Service to sort search results by that property.

Results can be ascending or descending based on OrderDirection. If you enter an invalid property, no search results are returned.

If you specify CustomOrderBy and OrderBy, the OrderBy property is ignored. The Friendly Name of a property can be found in Computer Management > Services and Applications > Indexing Service > Your Index > Properties > Friendly Name column.

String

CustomXml

(Code Behind Only)

Provides a mechanism to inject custom XML into the generated XML before being processed by the XSLT. The injected XML is appended to the end of the XML produced by this control. See Also:

Displaying Custom XML in Ektron’s Server Controls

String

DisplayXslt

Specify an external XSLT file to render the control. By default, the control uses ProductSearch.xsl. This file is located in
<SiteRoot>\Workarea\Xslt\Commerce

Important: If you want to edit this file, it is strongly recommended that you make a copy, change its name and move it outside your site’s Workarea folder. If you make changes to this file and do not move it out of the Workarea folder, this file and the changes will be lost when you upgrade.

String

 

DoInitFill

By default, Fill occurs during the Page_Init event. Set to false if you want to postpone the fill-action until later. In this case, FIll is automatically called during the Page Render event.

You might do this if you need to set or change a property on the control in codebehind and have it render with your changes shown.

Boolean

DynamicProductParameter

The QueryString parameter name which is used to pass the product ID to the product details page. For example, if your QueryString parameter for products is ID, enter that in this property. Then, when site visitors click a product in their search results, this parameter is passed with the product’s ID to the product details page.

String

EnableAdvancedLink

Set to True to display an Advanced Search tab on the ProductSearch control.

Boolean

Hide

Used to hide ProductSearch Server Control in design time and runtime.

True = Hide control

False = Show control

Boolean

Language

If the template on which this server control resides includes a language selection control, and you want to let the site visitor select the language, enter zero (0).

Otherwise, click the field, then ellipsis () and a popup box appears. Select a language from the list.

This property shows results in design-time (in Visual Studio) and at run-time (in a browser).

Integer

LinkTarget

Defines how a link on the search results display acts when clicked. The choices are:

_blank - loads the link in a new blank window. This window is not named.

_self - loads the link in the same window the anchor was clicked in. This is useful for overriding a globally assigned base target.

_parent - loads the link in the immediate frameset parent of the document. This defaults to acting like “_self” if the document has no parent.

_top - loads the link in the full body of the window. This defaults to acting like “_self” if the document is already at the top. It is useful for breaking out of an arbitrarily deep frame nesting.

String

LoadingImage

The image to display while the product search is loading.

The default is ajaxloader_circle_lg.gif.

This file is located in: <siteroot>
\Workarea\images\application

String

MaxCharacters

The maximum number of characters the Search text box accepts.

If you enter a value less than 50, set the TextBoxSize property to the same number.

Integer

MaxTeaserLength

Limits the length of any returned content’s abstract. To allow unlimited length, set to zero.

This property is active only if both of these conditions are true.

You use the DisplayXslt property to identify an XSLT and ecmteaser as a value of that property.

the ShowCustomSummary property is set to false. If ShowCustomSummary is set to true, the entire summary appears in search results.

Integer

OrderBy

The order of search results. For example, you want to sort search results by last modified date.

Note: The Order Direction field determines the direction of the search results. For example, if you sort by ID and OrderDirection is set to Descending, the results sort by ContentID number with the highest number at the top of the list.

String

OrderDirection

The direction in which search results are sorted. The default is Ascending.

Ascending - Alphabetical results from A to Z; numeric values low to high; dates from oldest to most recent

Descending - Alphabetical results from Z to A; numeric values high to low; dates from most recent to oldest

String

Recursive

Set to True to search sub-folders of the starting folder. The starting folder is identified in the CatalogID property.

Boolean

ResultsPageSize

Set the maximum number of results on a page. If a search returns more than this number of results, the following text appears below the last one:

Result Page: 1 2 3 Next

The site visitor can click Next or a number to view additional results.

This property defaults to the value set at the ek_PageSize element in the web.config file.

Integer

ResultTagId

Lets you designate where search results appear. You can place search criteria in one area of a Web form and the results in another.

For example, you have the following tag.

<span id=”results”></span>

In this case, enter results for this property value.

Additional information can be found in the WebSearch server control section ResultTagId.

String

ShowCategories

If set to true, when this server control appears, the site visitor see a Filter by Category option. This option helps a site visitor zero in on relevant content.

If false, the Filter by Category option does not appear.

Note: To see the Filter by Category option, the ShowSearchBoxAlways property must be set to true.

See Also: Filtering Search Results by Category

Boolean

ShowCustomSummary

If set to true, the search results display the content item’s summary instead of the characterization.

Note: If this property is set to true, the MaxTeaserLength property is ignored. So, the entire summary appears with search results, regardless of length.

If false, the search results display the characterization.

The default is false.

See Also: Display of Search Results

Boolean

ShowSearchBoxAlways

If set to true, the search box appears on the PostBack screen.

If false, the search box does not appear on the PostBack screen.

The default is true.

Boolean

Stylesheet

Specify the location of a style sheet to use for the search results page. Set the location relative to the site root folder. For example: Workarea\csslib\mytest.css

String

SuppressWrapperTags

Suppresses the output of span/div tags around the control. The default is False.

True - Suppress wrap tags.

False - Allow wrap tags.

Boolean

TaxonomyOperator

Select whether to use an And or Or operator when filtering results by taxonomy. By default, the property is set to Or. This allows for a wider range of returned results.

And - Only results that match all categories selected in the Filter by Category tree appear. For example, if you are searching for a medical document in the Hospital and Doctor’s Office categories, the document must be assigned to both categories or it is not shown.

Or - when more than one category is selected in the Filter by Category tree, results must match at least one category to be shown.

Note: For this property to be active, the ShowCategories property must be set to True.

See Also: Filtering Search Results by Category

Enum -TaxCategoryOperator

TemplateCart

Controls whether the Add to Cart link appears with search results. Enter the URL path of the template that contains the Cart server control. This path can be relative or absolute.

See Also: The Add to Cart Link in a Search Result and Cart Server Control.

String

TemplateProduct

Specify the URL that contains the Product server control. This allows a site visitor to see the details of the product when the product link is clicked. This path can be relative or absolute.

String

TextBoxSize

The size of the Search text box for user input. The width is based on the number of characters.

Integer


Visit the Ektron Dev Center at http://dev.ektron.com 1-866 - 4 - EKTRON

Ektron CMS400.NET Reference Version 8.02 SP1 Rev 1

Ektron Documentation,© 2011 Ektron, Inc.